***************************************************************
****Replication file for Ryan E. Carlin & Timothy Hellwig "The World Economy, Political Control, and Presidential Success." forthcoming in The Journal of Politics***
***************************************************************

****************************
***code to replicate Table A6 in SI file
****************************
use "ead_monthly_wide.dta", replace
tsset ticker
dfuller arg
dfuller bra
dfuller bol
dfuller chl
dfuller col
dfuller cri
dfuller dom
dfuller ecu
dfuller gtm
dfuller hnd
dfuller mex
dfuller nic
dfuller pan
dfuller pry
dfuller per
dfuller slv
dfuller ury
dfuller ven

/*unit roots for chl, col, dom, mex, nic, per, ury, ven, geti*/

qui arfima geti, ar(1/2) ma(1/2)
estat ic
arfima geti, ar(1/3) ma(1)
predict geti_fd, fdifference

arfima mex, ar(1/2) ma(1/2)
predict mex_fd, fdifference
reg mex_fd l(1/2).mex_fd geti_fd
estat durbinalt
estat bgodfrey, lags(4)
predict mex_e if e(sample)
dfuller mex_e, lags(1) dr
drop mex_e
reg mex_fd l.mex_fd geti_fd
estat durbinalt
estat bgodfrey, lags(4)
predict mex_e if e(sample)
dfuller mex_e, lags(1) dr

arfima chl, ar(1)
predict chl_fd, fdifference
reg chl_fd l.chl_fd geti_fd 
estat durbinalt
estat bgodfrey, lags(4)
predict chl_e if e(sample)
dfuller chl_e, lags(1) dr

arfima col if ticker>290 & timevar<2012, ar(1)
predict col_fd, fdifference
reg col_fd l.col_fd geti_fd if ticker>290 & timevar<2012
estat durbinalt
estat bgodfrey, lags(4)
predict col_e if e(sample)
dfuller col_e, lags(1) dr

arfima dom if ticker>317, ar(1)
predict dom_fd, fdifference
reg d.dom ld.dom geti_fd if ticker>317
estat durbinalt
estat bgodfrey, lags(4)
predict dom_e if e(sample)
dfuller dom_e, lags(1) dr

arfima nic if timevar<2013, ar(1/2)
predict nic_fd, fdifference
reg nic_fd l.nic_fd geti_fd if timevar<2013
estat durbinalt
estat bgodfrey, lags(4)
predict nic_e if e(sample)
dfuller nic_e, lags(1) dr

arfima per if ticker>276, ar(1) ma(1) 
predict per_fd, fdifference
reg per_fd l.per_fd geti_fd if ticker>276
estat durbinalt
estat bgodfrey, lags(4)
predict per_e if e(sample)
dfuller per_e, lags(1) dr

arfima ury, ar(1) 
predict ury_fd, fdifference
reg ury_fd l.ury_fd geti_fd
estat durbinalt
estat bgodfrey, lags(4)
predict ury_e if e(sample)
dfuller ury_e, lags(1) dr

arfima ven, ar(1) ma(1)
predict ven_fd, fdifference
reg ven_fd l.ven_fd geti_fd
estat durbinalt
estat bgodfrey, lags(4)
predict ven_e if e(sample)
dfuller ven_e, lags(1) dr

reg arg l.arg geti_fd
estat durbinalt
estat bgodfrey, lags(4)
predict arg_e if e(sample)
dfuller arg_e, lags(1) dr
reg bra l.bra geti_fd
estat durbinalt
estat bgodfrey, lags(4)
predict bra_e if e(sample)
dfuller bra_e, lags(1) dr
reg cri l.cri geti_fd
estat durbinalt
estat bgodfrey, lags(4)
predict cri_e if e(sample)
dfuller cri_e, lags(1) dr
reg ecu l.ecu geti_fd
estat durbinalt
estat bgodfrey, lags(4)
predict ecu_e if e(sample)
dfuller ecu_e, lags(1) dr
reg gtm l.gtm geti_fd
estat durbinalt
estat bgodfrey, lags(4)
predict gtm_e if e(sample)
dfuller gtm_e, lags(1) dr
reg hnd l.hnd geti_fd
estat durbinalt
estat bgodfrey, lags(4)
predict hnd_e if e(sample)
dfuller hnd_e, lags(1) dr
reg pan l.pan geti_fd if ticker>301
estat durbinalt
estat bgodfrey, lags(4)
predict pan_e if e(sample)
dfuller pan_e, lags(1) dr
reg pry l.pry geti_fd
estat durbinalt
estat bgodfrey, lags(4)
predict pry_e if e(sample)
dfuller pry_e, lags(1) dr
reg slv l.slv geti_fd
estat durbinalt
estat bgodfrey, lags(4)
predict slv_e if e(sample)
dfuller slv_e, lags(1) dr

log close

